import { request } from "@/utils/service"

import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API
/** 根据套餐/产品id查询详情 */
export function getComboDetail(params: any) {
  return request<any>({
    url: "/appletms/package/queryId",
    method: "get",
    params
  })
}

export function createOrderH5DataApi(data: any) {
  return request({
    url: `/api/msOrder/submit`,
    method: "post",
    data
  })
}

/** 修改 */
export function updateH5OrderDataApi(data: any) {
  return request({
    url: "/ms/update",
    method: "put",
    data
  })
}

/** 查 */
export function getH5OrderDataApi(params: any) {
  return request({
    url: "/ms/querys",
    method: "get",
    params
  })
}
/**删除 */
export function delH5OrderDataApi(h5_id: any) {
  return request({
    url: "/ms/del",
    method: "delete",
    params: {
      h5_id
    }
  })
}

//修改重新提交

export function updateAndPushH5OrderDataApi(data: any) {
  return request({
    url: "api/msOrder/anewSubmit",
    method: "post",
    data
  })
}

// 订单导出

export function downLoadOrderH5Table(data: any) {
  return axios({
    url: `${baseURL}/ms/downOrder`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data,
    responseType: "blob"
  })
}
